1. Field of the Invention
The invention relates generally to data storage systems, and more particularly to systems and methods for preventing lookup operations in a content addressable memory (CAM) from returning incorrect data as a result of concurrent write operations changing the data values stored in the CAM array.
2. Related Art
Data that is stored in a memory (e.g., RAM in a computer) is typically stored and retrieved based upon a particular address in the memory. In other words, a particular data value is stored at a specific address that defines a corresponding location in the memory. When the data value is needed, it is retrieved by reading the value from the address in the memory at which the data was previously stored. Thus, while the specific value of the stored data may not be known, the data can be easily accessed because the specific address at which the data was stored is known.
One alternative mechanism for storing data is a content addressable memory (CAM.) A CAM is a data storage structure which is designed so that data entries in the structure can be accessed by addressing the content of the memory locations, rather than the specific addresses of the memory locations. When a particular data value is stored in a CAM, the specific memory location in which the data is stored may not be known. The data can still be accessed, however, because at least a portion of the data itself is known, and the data can be located and accessed based upon this information. The known portion of the data is typically an identifier, or tag, which is appended to the data specifically for the purpose of being able to locate and access the data in the CAM.
CAMs may be useful in a variety of applications. For example, in networking systems in which packets of data are transmitted between multiple network nodes, packet data may be stored in a CAM. When it is necessary to retrieve the data for a particular packet, the data can be accessed using packet header information that functions as a tag for the data. In another example, commands and data transmitted between multiple master and slave devices in a multiprocessor computing system may be stored in a CAM with tag information that is appended to the information specifically for the purpose of enabling a receiving device to identify and retrieve the corresponding commands and/or data.
System designers may be faced, however, with various problems relating to the use of CAMs for storing data. Consider the example of a multiprocessor system in which a CAM is used to store commands and/or data. In this system, the various master and slave devices may issue commands that direct the execution of such actions as looking up an entry in a CAM, or writing a new entry to the CAM. Some of these commands may be issued at the same time. In particular, it is possible for the devices to issue simultaneous commands to look up a particular entry in a CAM and also to write to the same entry in the CAM. In this case, the lookup action may find the correct entry in the CAM, but the entry may be overwritten with new data before the desired data can be retrieved from the CAM. The lookup of the earlier data would therefore be corrupted.
It would therefore be desirable to provide a mechanism for ensuring that the data looked up in the CAM is successfully read out without interference from the subsequent data write to the same CAM entry.